home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1996 #4 / Amiga Plus CD - 1996 - No. 4.iso / pd / daten / abxcd_v1.0 / startup.doc < prev    next >
Text File  |  1995-09-27  |  20KB  |  578 lines

  1. Startup.doc  written by C. Dean  September 1995.
  2.  
  3.  
  4. How To Run ABxCD from the Workbench
  5. -----------------------------------
  6.  
  7. Just double click on the ABxCD.b0 database icon.
  8. This starts up ABxCD in interactive mode.
  9. Standard output is re-directed to the file ABxCD.stdout.
  10.  
  11.  
  12. How To Run ABxCD from the CLI
  13. -----------------------------
  14.  
  15. ABxCD takes the following parameters:-
  16.  
  17.     ABxCD  <command>  <options>
  18.  
  19. where <command> is one of:-
  20.  
  21.     createdb    - to create the database files.
  22.     buildhyperidx    - to re-build the hypertext index.
  23.     execfile    - to execute a file of ABxCD commands.
  24.     execicode    - to execute some icode.
  25.     rexx        - to execute some icode and wait for arexx commands.
  26.     create0S    - to create a 0 dimensioned string variable.
  27.     create1S    - to create a 1 dimensioned string variable (table).
  28.     create0L    - to create a 0 dimensioned integer variable.
  29.     create1L    - to create a 1 dimensioned integer variable.
  30.     deleterecs    - to delete the records of a database table.
  31.     deletevar    - to delete a variable.
  32.     get        - to get a record from a database table.
  33.     put        - to put a record into a database table.
  34.     getall        - to get all records from a database table.
  35.     putall        - to put all records into a database table.
  36.     putimage    - to put an icon image into the database.
  37.     populate    - to populate a table with records.
  38.     extend        - to re-size a table.
  39.     report        - to report on the database variables.
  40.     modifystructure    - to add or delete fields in a table.
  41.     checkdb        - to verify database structures.
  42.     compressdb    - to reduce fragmentation within the database.
  43.  
  44. and <options> are any of the following:-
  45.  
  46.     db=<dbname>        - specifies the database name.
  47.     ini=<filename>        - specifies the initialisation file to use.
  48.     info=<number>        - sets info level ( 1, 2 or 3 ).
  49.     icdiag=<number>        - sets the icode diagnostic level.
  50.     csmap=<name>        - specified colour/style map to use.
  51.     noautoflush        - disable automatic disk database updates.
  52.     compall            - compile all screens and icode at startup.
  53.     border=<number>        - sets the border character of active forms.
  54.     first=<formname>    - specifies first form to display.
  55.     fontname=<fontname>    - specifies the font to use.
  56.     fontsize=<fontsize>    - specifies the font size to use.
  57.     buffers=<number>    - sets the number of 32k tdb buffers to use.
  58.     keys=<number>        - reserves space for icode literal names.
  59.     strings=<number>    - reserves space for icode strings.
  60.     arrays=<number>        - reserves space for icode arrays.
  61.     procs=<number>        - reserves space for icode procedures.
  62.     cell=<number>        - specifies a record number.
  63.     cell=*            - specifies all records.
  64.     cell=+            - specifies next available record number.
  65.     var=<varname>        - specifies variable name.
  66.     file=<filename>        - specifies filename.
  67.     icode=<icode>        - specifies icode to be executed.
  68.     contents=<searchstr>    - specifies cell by first line contents.
  69.     size=<number>        - specifies record average size in bytes.
  70.  
  71. If <command> is absent ABxCD runs in interactive mode, displaying the
  72. first form on the screen. Invoking ABxCD with no parameters is the normal
  73. way.
  74.  
  75. The options:- ini=, noautoflush, compall, border=, buffers=, keys=, strings=,
  76. arrays=, procs=, csmap=, first=, fontname= and fontsize= are used when
  77. running interactively.
  78.  
  79. The options:- ini=, buffers=, keys=, strings=, arrays=, procs=, icode=,
  80. file=, cell= and contents= are used when executing some icode (execicode
  81. and rexx commands).
  82.  
  83. The db= option names the database files to use. The default is 'ABxCD'
  84. which uses the database files ABxCD.b0 and ABxCD.b1.
  85.  
  86. The ini= option specifies an initialisation file which may contain further
  87. options. Only the options noautoflush, border=, buffers=, keys=, strings=,
  88. arrays=, procs=, csmap=, first=, fontname=, fontsize=  are allowed in an
  89. initialisation file. If no ini= option is present, the file <dbname>.ini
  90. is used, if it exists.
  91.  
  92. The csmap= option is to specify which colour/style map to use. If none
  93. is specified, the map named 'default' is used. These maps are records in
  94. the variable sys_colstyle.
  95.  
  96. The border= option sets the ascii value of the character used as a border
  97. for the active form. The default is 32 (space). A value of 127 looks good
  98. on mono displays.
  99.  
  100. The first= option specifies the name of the form to be displayed first.
  101. If omitted, the form called "first" is first displayed.
  102.  
  103. The fontname= option specifies the font name to be used to display all
  104. text in ABxCD. Use with the fontsize= option. If omitted, the workbench
  105. font is used. Proportional spaced fonts are not allowed.
  106.  
  107. The buffers= option is to set the number of 32k byte buffers for use with
  108. the tdb database. A larger value may improve performance.
  109.  
  110. The keys= option reserves space for all icode defined names, also known as
  111. literals.
  112.  
  113. The strings= option reserves space for the contents of all str type icode
  114. variables.
  115.  
  116. The arrays= option reserves space for the contents of all array type icode
  117. variables.
  118.  
  119. The procs= option reserves space for the contents of all proc type icode
  120. variables i.e. procedure bodies. Also known as dictionary space.
  121.  
  122. Use the icode proc icspace() to find out how much of each type of space
  123. is being used and how much is available.
  124.  
  125. If not otherwise specified, ABxCD runs with the following values:-
  126.  
  127.     buffers=6  keys=1000  strings=10000  arrays=500  procs=20000
  128.  
  129. which occupies 6*32768 + 1000*52 + 10000 + 500*4 + 20000*4 bytes.
  130.  
  131.  
  132. Running ABxCD Interactively
  133. ---------------------------
  134.  
  135. To speed up the time it takes ABxCD to start up, the forms and their
  136. associated icode are not compiled at startup; instead they are compiled
  137. as required when the form is to be displayed. The compall option may
  138. be used to compile all forms and their icode at startup.
  139. It may take a second or two to compile the form and its associated
  140. icode.
  141.  
  142. If the database is on a floppy disk, set the noautoflush option to disable
  143. the automatic flushing of changed data to disk every 2 seconds. Use the
  144. flush-buffers function (key ^U) to keep the disk up-to-date.
  145.  
  146. If possible, an arexx port named ABxCD is setup and the facilities detailed
  147. under the rexx section below are available interactively.
  148.  
  149.  
  150. Details for the above commands
  151. ------------------------------
  152.  
  153. createdb
  154. --------
  155.  
  156. To create a database with a name mydb:-
  157.  
  158.     ABxCD createdb db=mydb
  159.  
  160. This creates two files, mydb.b0 and mydb.b1, which are the database files.
  161. If the db= option is omitted, the database name defaults to ABxCD.
  162.  
  163.  
  164. buildhyperidx
  165. -------------
  166.  
  167. Whenever the hypertext help pages are modified or first installed, the
  168. hypertext index needs to be re-built. This is done by:-
  169.  
  170.     ABxCD buildhyperidx
  171.  
  172.  
  173. execfile
  174. --------
  175.  
  176. To speed up the getting and putting of many files into and from the database,
  177. these commands can be put into a file and executed using the execfile command.
  178. Only get, put, getall, putall, create0S, create1S, create0L, create1L, report,
  179. extend, deleterecs, deletevar and populate commands are allowed in a file
  180. that is executed using execfile.
  181. Example usage:-
  182.  
  183.     ABxCD execfile file=myfile
  184.  
  185. where myfile contains:-
  186.  
  187.     ABxCD create1S var=sys_icode
  188.     ABxCD put var=sys_icode cell=+ file=rep1.icode
  189.     ABxCD put var=sys_icode cell=+ file=rep2.icode
  190.  
  191.  
  192. execicode
  193. ---------
  194.  
  195. All icode is stored in the sys_icode variable.
  196. To compile and interpret a record in the sys_icode variable use:-
  197.  
  198.     ABxCD execicode  contents=rep1
  199.  
  200. This assumes there is a record whose first line contains the string 'rep1'.
  201. The record may also be specified using the cell= option.
  202.  
  203. The record usually only contains the procedure definitions; to execute
  204. some procedure use, for example:-
  205.  
  206.     ABxCD execicode contents=rep1 "icode=rep1( 67 );"
  207.  
  208. Double quotes are required because of the spaces and semi-colon in the
  209. string (although neither spaces nor semi-colon is required here).
  210.  
  211. Files may also be interpreted; use the file= option to specify the file
  212. to be executed. The first two lines of the file are ignored. For example:-
  213.  
  214.     ABxCD execicode icode=test("orders") file=test.ic
  215.  
  216. If both a file and a record are specified, the record is interpreted first.
  217. The sys_icode record called "first" is always compiled and interpreted
  218. first.
  219.  
  220.  
  221. rexx
  222. ----
  223.  
  224. This command is identical to the execicode command, executing some icode
  225. in background then waiting for arexx commands on the port named ABxCD.
  226. The following arexx commands are supported:-
  227.  
  228.     QUIT
  229.     COMPILE   "record name"
  230.     ICODE     "icode procs"
  231.     KEYVALUE  keynumber
  232.     KEYSTRING "string"
  233.  
  234. Note that arexx commands are also handled in interactive mode and the
  235. icode proc icdorexx() issues synchronous arexx commands to other
  236. applications. Arexx programs that wish to call icode procs should be
  237. started from icode using:-
  238.     system( "run rx myrexxprogram" );
  239.  
  240. The quit command causes ABxCD to terminate, but is ignored if running
  241. interactively.
  242. The compile command causes the record in the sys_icode variable to be
  243. compiled and interpreted if not previously compiled.
  244. The icode command causes the parameter string to be interpreted. Note that
  245. it is not possible to interprete icode while already interpreting icode.
  246. The arexx result string is the contents of an icode string which is defined
  247. by calling the icode proc icrexxresult().
  248. The keyvalue and keystring commands can only be used when running
  249. interactively. Keyvalue places the decimal keynumber value in the input
  250. stream as though typed in by the user. Keystring places the string in the
  251. input stream. Note the following special values of keynumber that may be
  252. used:-
  253.     256-259:  arrow keys up, down, left, right
  254.     260-263:  shift arrow keys
  255.         264:  help key
  256.         267:  backtab key (shift tab)
  257.     268-277:  F1 to F10
  258.     278-287:  shift F1 to shift F10
  259.  
  260.  
  261. create0S
  262. --------
  263.  
  264. To create a 0 dimensioned string variable, i.e. a table capable of storing
  265. only one record, use, for example:-
  266.  
  267.     ABxCD create0S var=picklist
  268.  
  269.  
  270. create1S
  271. --------
  272.  
  273. To create a 1 dimensioned string variable, i.e. a table capable of storing
  274. many records, use, for example:-
  275.  
  276.     ABxCD create1S var=sys_icode
  277.  
  278.  
  279. create0L
  280. --------
  281.  
  282. To create a 0 dimensioned integer variable, i.e. a 4 byte area capable of
  283. storing a single integer, use, for example:-
  284.  
  285.     ABxCD create0L var=order_number
  286.  
  287.  
  288. create1L
  289. --------
  290.  
  291. To create a 1 dimensioned integer variable, i.e. an array capable of storing
  292. many integers, use, for example:-
  293.  
  294.     ABxCD create1L var=sales_by_week
  295.  
  296.  
  297. deleterecs
  298. ----------
  299.  
  300. To delete the records in a 1 dimensioned string variable use:-
  301.  
  302.     ABxCD deleterecs var=sys_icode
  303.  
  304. The cell 0 datafile structure record is not deleted.
  305.  
  306.  
  307. deletevar
  308. ---------
  309.  
  310. To delete a variable use:-
  311.  
  312.     ABxCD deletevar var=sys_icode
  313.  
  314. If the variable is a 1 dimensioned string then the variable must be empty,
  315. i.e. contain no records (apart from the cell 0 datafile structure record).
  316. Use deleterecs to delete all records in a string variable.
  317.  
  318.  
  319. get
  320. ---
  321.  
  322. To get a record from a string variable, use, for example, either:-
  323.  
  324.     ABxCD get var=sys_icode cell=12 file=rep1.icode
  325.  
  326. or    ABxCD get var=sys_icode contents=rep1 file=rep1.icode
  327.  
  328. The file rep1.icode is created or overwritten with the record contents.
  329.  
  330. The contents= option identifies a record by the contents of its first field.
  331. In the above example, all records are searched for the string 'rep1' in
  332. the first field and, providing only one record matches, that record is used.
  333.  
  334. If the file= option is omitted, the record contents are written to standard
  335. output. If the variable is of 0 dimension, the cell= and contents= options
  336. may be omitted.
  337.  
  338. To get a series of records from the database, use, for example:-
  339.  
  340.     ABxCD get var=sys_icode cell=* file=rep999.icode
  341.  
  342. The filename 'rep999.icode' is a template which must contain a number, in
  343. this case 999, which has upto 6 digits in it.
  344. All records in cells 0 to 999 are written to the files rep000.icode,
  345. rep001.icode, etc. No files are created for records that do not exist.
  346. Note that cell 0 contains a special record used for checking datafile
  347. structure.
  348.  
  349.  
  350. put
  351. ---
  352.  
  353. To put a record into a string variable, use, for example, one of:-
  354.  
  355.     ABxCD put var=sys_icode cell=12 file=rep1.icode
  356.  
  357. or    ABxCD put var=sys_icode cell=+ file=rep1.icode
  358.  
  359. or    ABxCD put var=sys_icode contents=rep1 file=rep1.icode
  360.  
  361. The file rep1.icode is read and its contents put into the database.
  362.  
  363. The cell=+ option puts the record into the next available cell. Cells of
  364. previously deleted records are re-used.
  365.  
  366. The contents= option is used to select a record to be overwritten.
  367.  
  368. If the file= option is omitted, the record contents are read from standard
  369. input. If the variable is of 0 dimension, the cell= and contents= options
  370. may be omitted.
  371.  
  372. No checking is performed on the contents of the record being put into the
  373. database; it is vital that the record conforms to the correct structure.
  374.  
  375. To put a series of records into the database, use, for example:-
  376.  
  377.     ABxCD put var=sys_icode cell=* file=rep999.icode
  378.  
  379. The filename 'rep999.icode' is a template which must contain a number, in
  380. this case 999, which has upto 6 digits in it.
  381. All the files rep000.icode, rep001.icode, etc. are read and put into the
  382. corresponding cells.
  383.  
  384. Note that cell 0 contains a special record used for checking datafile
  385. structure.
  386.  
  387.  
  388. getall
  389. ------
  390.  
  391. To get all records of a string variable, use getall as follows:-
  392.  
  393.     ABxCD getall var=sys_icode file=x.x
  394.  
  395. The file x.x is created and filled with all the records of the variable.
  396. Using getall is faster than using get cell=* since only one file is written.
  397.  
  398.  
  399. putall
  400. ------
  401.  
  402. To put all records back into a string variable, use putall as follows:-
  403.  
  404.     ABxCD putall var=sys_icode file=x.x
  405.  
  406. The variable must exist and contain no records before using putall.
  407. The file must have been created using getall.
  408.  
  409.  
  410. putimage
  411. --------
  412.  
  413. To read an IFF ILBM or icon image and put it into the sys_image database
  414. variable use:-
  415.  
  416.     ABxCD putimage contents=name file=x.x
  417.  
  418. The file is first checked to see if it is a valid IFF. The iffparse.library
  419. is required to read IFFs. If the file cannot be read as an IFF, the image
  420. taken from the file's unselected icon (.info file) is read.
  421. If the image has more than 8 colours only the first 3 bitplanes are read
  422. to produce an 8 colour image. The resulting image is stored in the sys_image
  423. 1 dimensioned string type variable in an internal format suitable for the
  424. icode proc ugdrawimage(). The contents name is used to identify the image.
  425. Any existing image in the sys_image variable with the same name is
  426. overwritten. If the file= parameter is omitted, any image with that name
  427. is deleted. The icode proc ugloadimage() does the same as putimage.
  428.  
  429.  
  430. populate
  431. --------
  432.  
  433. To generate random records, use extend then populate as follows:-
  434.  
  435.     ABxCD populate var=sys_icode cell=10000 file=template
  436.  
  437. This reads the file template and generates records for cells 1 to 10000
  438. of the 1 dimensioned string variable according to the template. The template
  439. file may contain any of the following special sequences:-
  440.  
  441.     %<d>    - where <d> is a digit 1 to 6 - substitute next integer
  442.             using <d> decimal places.
  443.     %<c>    - where <c> is a character 'a' to 'f' - substitute a
  444.             random integer using 1 to 6 decimal places.
  445.     %x    - substitute a random character.
  446.  
  447. Populate may also be used to delete all records in a variable. First
  448. create an empty file called 'empty' then use populate as follows:-
  449.  
  450.     ABxCD populate var=sys_icode cell=* file=empty
  451.  
  452.  
  453. extend
  454. ------
  455.  
  456. ABxCD automatically extends variables as required. When a table has to
  457. be extended, either because it needs more cells or because it needs more
  458. record space, it is copied within the database and given 25% more record
  459. space than currently occupied and upto 50% more cells than cells used.
  460.  
  461. As a result of this copy, the database file itself may need to be extended.
  462. If a very large variable has to be extended several times, the database
  463. file will grow to at least three times the size of the large variable.
  464.  
  465. The extend facility allows a 1 dimensioned string variable to be sized by
  466. the user so as to avoid the above problems and save the time that would be
  467. spent doing automatic extends. For example:-
  468.  
  469.     ABxCD extend var=sys_icode cell=10000 size=125
  470.  
  471. This extends the variable to allow for 10000 cells and provide record space
  472. for 10000 records each with an average size of 125 bytes.
  473.  
  474. Note that using extend with cell=0 and size=0 shrinks the table to its
  475. smallest possible size but does not reduce the number of allocated cells.
  476. The compressdb command does alter the number of cells of variables it
  477. moves.
  478.  
  479.  
  480. report
  481. ------
  482.  
  483. To find out the names, cells in use, sizes etc. of all variables in the
  484. database use:-
  485.  
  486.     ABxCD report
  487.  
  488. To get a list of the first field contents of all records in a variable use:-
  489.  
  490.     ABxCD report var=sys_icode cell=*
  491.  
  492. The cell= option may be used to limit the number of cells reported. If
  493. this option is omitted, only the first 20 cells are reported.
  494.  
  495.  
  496. modifystructure
  497. ---------------
  498.  
  499. This command is to allow changes to the field structure of the variables.
  500.  
  501. The following rules apply:-
  502.  
  503. a) If adding a non-scrolling field it must be placed before all scrolling
  504.    fields.
  505. b) If adding a member of a scrolling field it must not have the 'F'
  506.    (first scrolling) attribute.
  507. c) If adding a new scrolling area it must be placed after all fields.
  508.  
  509.  
  510. To add a data field in a variable use the following procedure:-
  511.  
  512. a) Run ABxCD interactively. Using the system datafile forms under system
  513.    maintainance, add a new subrecord entry for the new field and give it
  514.    the attribute '+'. Exit ABxCD.
  515.  
  516. b) Run ABxCD with the modifystructure command:-
  517.  
  518.     ABxCD modifystructure
  519.  
  520. c) Run ABxCD interactively. Ignore the error
  521.    'addfield or delfield attr needs modifystructure' and others caused by this.
  522.    Using the system datafile forms under system maintainance, remove the
  523.    '+' attribute. Exit ABxCD.
  524.  
  525.  
  526. To delete a data field use the following procedure:-
  527.  
  528. a) Run ABxCD interactively. Using the system datafile forms under system
  529.    maintainance, give the field to be deleted the '-' attribute. Exit ABxCD.
  530.  
  531. b) Run ABxCD with the modifystructure command:-
  532.  
  533.     ABxCD modifystructure
  534.  
  535. c) Run ABxCD interactively. Ignore the error:-
  536.    'invalid data description change (...)' and others caused by it.
  537.    Using the system datafile forms under system maintainance, delete the
  538.    subrecord defining the field. Exit ABxCD.
  539.  
  540.  
  541. checkdb
  542. -------
  543.  
  544. This command verifies a database, checking for internal corruption. It also
  545. zeroes all the free areas between variables and shows the location and size
  546. of free areas and variables. The compress factor is shown.
  547.  
  548.  
  549. compressdb
  550. ----------
  551.  
  552. This moves variables within the database in order to reduce fragmentation.
  553. As variables grow they are moved and allocated a larger space within the
  554. database file. This leaves a free area which may be re-used. When a free
  555. area is re-used often only part of it is used leaving a smaller free area.
  556. Adjacent free areas are joined into one larger free area automatically.
  557.  
  558. Over time, the database will contain many small free areas rather than
  559. just a few large ones which means that when a large variable has to be
  560. moved the database file must be extended to accomodate it. The compressdb
  561. command moves five carefully selected variables in order to move the free
  562. areas together. Use the compressdb command several times until fragmentation
  563. is sufficiently reduced. As a guide to the level of fragmentation, the
  564. compress factor is shown; this is the percentage of free areas to variables;
  565. values over 50 are bad and compressdb should be run repeatedly until the
  566. compress factor goes below 10. When running interactively, if the compress
  567. factor is over 50 the system automatically performs a compress; this is
  568. done after there have have been no keypresses for two seconds.
  569.  
  570. Moved 1-dimension string type variables are re-sized to allow for 25%
  571. free space and 50% unused cells.
  572.  
  573. The compressdb command normally does not cause the database file to be
  574. extended but may, on rare occasions, do so. Generally, if the database
  575. file is about to be extended this is detected and a warning is issued.
  576. Also, when a database cannot be further compressed a warning is issued.
  577. These warnings appear as error numbers T32 and T33.
  578.